package com.pwc.pluginDelay;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author fantuancyh
 * @data 2021/8/22
 */

@Component
public class Consumer {
    private static final String QUEUE_NAME = "delayed.queue";
    @RabbitListener(queues = QUEUE_NAME)
    public void process(Message testMessage, Channel channel) {
        System.out.println("DelayConsumer延迟插件收到消息: " + new String(testMessage.getBody())+"，时间为" +  new Date().toString());

    }
}
